import axios from "../../utils/request";

/// 审核管理
function getAudit(query) {
    return axios.get('/audit', { params: query })
}
function delAudit(id) {
    return axios.delete(`/audit/${id}`)
}
function editAudit(body) {
    return axios.put('/editAudit', body)
}

/// 订单列表
function getOrder(query) {
    return axios.get('/orders', { params: query })
}
function delOrder(id) {
    return axios.delete(`/orders/${id}`)
}

// 筛选订单
function switchOrder(type){
    return axios.get('/switchOrder', { params: type })
}
// 筛选审核
function switchAudit(type){
    return axios.get('/switchAudit', { params: type })
}

/// 搜索审核数据
function searchAudit(query){
    return axios.get(`/audit?keyword=${query}`)
}

export default {
    getAudit,
    delAudit,
    editAudit,
    getOrder,
    delOrder,
    switchOrder,
    switchAudit,
    searchAudit
}